#!/bin/bash

mount_nfs() {
    rpcbind
    mount -t nfs $1 /export/secondary

    /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt \
    -m /export/secondary \
    -u $2 \
    -h vmware -F
}

help() {
    cat <<EOF

registe systemvm to cloudstack

usage： register_tmpl <nfs_path> <url for systemvm ova>

example:
register_tmpl 200.200.200.1:/cloustack/p http://example.com/systemvm.ova

EOF
}

if [ ! $1 -o ! $2 ]; then
    help
else
    mount_nfs $1 $2
fi